package cn.zindesign.base;

import cn.zindesign.platform.service.ModelService;
import cn.zindesign.platform.service.PermissionService;
import cn.zindesign.platform.service.RolePermissionService;
import cn.zindesign.platform.service.RoleService;
import cn.zindesign.platform.service.RoleUserService;
import cn.zindesign.platform.service.UserService;

import cn.zindesign.system.AppContext;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @author lihui
 * Jan 8, 2012
 */
public class BaseAction extends ActionSupport {
	
	public UserService getUserService(){
		return (UserService) AppContext.getInstance().getAppContext().getBean("userService");
	}
	
	public PermissionService getPermissionService(){
		return (PermissionService) AppContext.getInstance().getAppContext().getBean("permissionService");
	}
	
	public RoleService getRoleService(){
		return (RoleService) AppContext.getInstance().getAppContext().getBean("roleService");
	}
	
	public RolePermissionService getRolePermissionService(){
		return (RolePermissionService) AppContext.getInstance().getAppContext().getBean("rolePermissionService");
	}
	
	public RoleUserService getRoleUserService(){
		return (RoleUserService) AppContext.getInstance().getAppContext().getBean("roleUserService");
	}
	
	public ModelService getModelService(){
		return (ModelService) AppContext.getInstance().getAppContext().getBean("modelService");
	}

}
